<?php
error_reporting(0);
define('IN_QY',true);
session_start();
require("include/common.inc.php");
require_once("include/config.php");
require_once("include/httpUtil.php");
require_once('config.php');

if($_GET['yqr']){
	
$yqr=$_GET['yqr'];	
}else{
	
$yqr="";	
}



?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>会员注册-众晒网</title>
		<link rel="stylesheet" href="/ui/login/css/base.css" />
		    <style>
			::-webkit-input-placeholder {
    /* WebKit browsers */
    color: #CCCCCC!important;
}

:-moz-placeholder {
    /* Mozilla Firefox 4 to 18 */
    color: #CCCCCC!important;
}

::-moz-placeholder {
    /* Mozilla Firefox 19+ */
    color: #CCCCCC!important;
}

:-ms-input-placeholder {
    /* Internet Explorer 10+ */
   color: #CCCCCC!important;
}			
		.t {
            margin-left:13px;
			text-decoration:none;
        }
		.nav {
    margin-top: 1rem;
    height: auto;
    overflow: hidden;
    padding-bottom: 2rem;
        }
    .nav ul {
    height: auto;
    overflow: hidden;
    clear: both;
      }
.nav ul li {
    width: 15%;
    float: left;
    margin-left: 13%;
    font-size: 1.2rem;
    text-align: center;
    margin-top: 2rem;
    line-height: 1.5rem;
}	
.nav ul li img {
    width: 100%;
    -webkit-animation-delay: 1.5s;
    -webkit-animation-duration: 2s;
}  
        #notice {
            color: red;
        }

    </style>
	
	</head>
	<body>
		<div class="bg_bank">
		  <div class="re_min_infor">

			    <div class="bg_color" style="margin-top: 99px;">	
				
                                <div class="re_min">
                                 
                                    <input class="input01" name="userid" id="userid" type="text" placeholder="请输入手机号" /><div id="div1"></div>
                                </div>
								
                                <div class="re_min">
                             
                                    <input class="input01"  class="login_btn" id="code" value="" name="code" type="text" placeholder="请输入验证码"/>
                                    <input  type="button" class="reto_code" id="send_code"   value="获取验证码" name="phone" onclick="showtime(60)"/>
                                </div>
								
                                <div class="re_min">
                               
                                    <input class="input01" name="shibie" id="shibie" type="text" value="<?php echo $_GET['yqr']?>" placeholder="邀请人(可选填)" /><div id="div1"></div>
                                </div>	
								
                 </div>
                            <div class="re_regist" style="margin-top: 0px;">
                                <button class="btn_regist" onclick="dll()" type="submit">下一步</button>
                            </div>
							
                                <div class="re_regist02">
                                <a class="t" href="mlogin.php"  style="text-decoration:none;color: #fe984c;">去登录</a>   
								<a class="t" href="javascript:void(0)" onclick="_MEIQIA('showPanel')" style="text-decoration:none;color: #fe984c;" >联系客服</a>   
								<a class="t" href="mwjmm.php"  style="text-decoration:none;color: #fe984c;">忘记密码</a>
                            </div>
			</form>
							
		  </div>
		</div>
		
    <script src="/wap/dl/lib/jquery-2.1.4.js"></script>	
	<script src="/wap/dl/lib/fastclick.js"></script>	
    <script type="text/javascript" src="/ui/layer/mobile/layer.js"></script>  	
 <script>
var _mtac = {};
(function() {
    var mta = document.createElement("script");
    mta.src = "http://pingjs.qq.com/h5/stats.js?v2.0.2";
    mta.setAttribute("name", "MTAH5");
    mta.setAttribute("sid", "500475478");
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(mta, s);
})();
</script>
<!-- 这是美洽的嵌入代码 -->
<script type='text/javascript'>
    (function(m, ei, q, i, a, j, s) {
        m[i] = m[i] || function() {
            (m[i].a = m[i].a || []).push(arguments)
        };
        j = ei.createElement(q),
            s = ei.getElementsByTagName(q)[0];
        j.async = true;
        j.charset = 'UTF-8';
        j.src = 'https://static.meiqia.com/dist/meiqia.js?_=t';
        s.parentNode.insertBefore(j, s);
    })(window, document, 'script', '_MEIQIA');
    _MEIQIA('entId', '65407');

    // 在这里开启无按钮模式（常规情况下，需要紧跟在美洽嵌入代码之后）
    _MEIQIA('withoutBtn');
</script>
<script type='text/javascript'>
    // 当你使用了「手动初始化」时，就可以在自己的逻辑中选择合适的时机调用 withoutBtn
    // 只要是在美洽初始化之前，就可以被正确执行
    _MEIQIA('withoutBtn');
    _MEIQIA('init');
</script>
<!-- 这是美洽的嵌入代码 -->
<script type="text/javascript">

function dll(){
		var tllphone = document.getElementById("userid").value;
		var code = document.getElementById("code").value;		
	    var code1='<?php echo $_COOKIE['code']?>';
	    var shibie1 = document.getElementById("shibie").value;		

	
if(tllphone==''){
  layer.open({
    content: '请填写手机号'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });

return false;

}

if(code==''){

  layer.open({
    content: '请填写验证码'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });

return false;

}


if(code==code1){

  layer.open({
    content: '验证码不正确'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });

return false;

}

 location.href = 'mmregister3.php?tui='+shibie1;  


return true;

}

</script> 


<script type="text/javascript">

function showtime(t){

		var tllphone = document.getElementById("userid").value;	
		if(tllphone==''){

		  layer.open({
    content: '请输入正确的手机号码！'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
		return false;

		}	



}

var flag = 1;  
var i = 55;  
function countDown() {  

 var div = document.getElementById("send_code");
    i = i - 1;  
	 div.style.setProperty('background-color','#cccccc');	
	$("#send_code").attr("disabled","disabled");
    $("#send_code").val(i+"秒后重新发送");  
	
    if (i == 0) {  
	 div.style.setProperty('background-color','#fe984c');
	 
	$("#send_code").removeAttr("disabled");;
        $("#send_code").val("重新发送");  
        flag = 1;  
        i = 55;  
        return;  
    }  
    setTimeout('countDown()',1000);  
} 

	$('#send_code').click(function(){
	var phone = document.getElementById("userid").value;
	var shibie = document.getElementById("shibie").value;	
		if(phone==''){
		  layer.open({
    content: '请输入正确的手机号码！'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
		return false;
		}
		 $.ajax({
        url: 'ifzhuche.php',
        type: 'POST',
        dataType: 'json',
        data: {
		phone: phone,
		shibie:shibie
		},
      })
    .done(function(respon) {
    if (respon.error==0) {         
			$.ajax({
			type: "POST",
			url: "sms_send.php",
			data: {phone:phone},
			dataType: "json",
			success: function (data) {
	  layer.open({
    content: '发送成功'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
countDown();
			}

			})   
    }else if(respon.error==1){
       	layer.open({
    content: '当前手机号已注册'
    ,btn: ['OK']
    ,yes: function(index){
	location.reload();
    }
  }); 
    }
    })

	});


</script>  
	    		
	</body>
</html>
